# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.BeyondCorp.V1.Model.CloudSecurityZerotrustApplinkAppConnectorProtoGateway do
  @moduledoc """
  Gateway represents a GCE VM Instance endpoint for use by IAP TCP.

  ## Attributes

  *   `interface` (*type:* `String.t`, *default:* `nil`) - interface specifies the network interface of the gateway to connect to.
  *   `name` (*type:* `String.t`, *default:* `nil`) - name is the name of an instance running a gateway. It is the unique ID for a gateway. All gateways under the same connection have the same prefix. It is derived from the gateway URL. For example, name=${instance} assuming a gateway URL. https://www.googleapis.com/compute/${version}/projects/${project}/zones/${zone}/instances/${instance}
  *   `port` (*type:* `integer()`, *default:* `nil`) - port specifies the port of the gateway for tunnel connections from the connectors.
  *   `project` (*type:* `String.t`, *default:* `nil`) - project is the tenant project the gateway belongs to. Different from the project in the connection, it is a BeyondCorpAPI internally created project to manage all the gateways. It is sharing the same network with the consumer project user owned. It is derived from the gateway URL. For example, project=${project} assuming a gateway URL. https://www.googleapis.com/compute/${version}/projects/${project}/zones/${zone}/instances/${instance}
  *   `selfLink` (*type:* `String.t`, *default:* `nil`) - self_link is the gateway URL in the form https://www.googleapis.com/compute/${version}/projects/${project}/zones/${zone}/instances/${instance}
  *   `zone` (*type:* `String.t`, *default:* `nil`) - zone represents the zone the instance belongs. It is derived from the gateway URL. For example, zone=${zone} assuming a gateway URL. https://www.googleapis.com/compute/${version}/projects/${project}/zones/${zone}/instances/${instance}
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :interface => String.t() | nil,
          :name => String.t() | nil,
          :port => integer() | nil,
          :project => String.t() | nil,
          :selfLink => String.t() | nil,
          :zone => String.t() | nil
        }

  field(:interface)
  field(:name)
  field(:port)
  field(:project)
  field(:selfLink)
  field(:zone)
end

defimpl Poison.Decoder,
  for: GoogleApi.BeyondCorp.V1.Model.CloudSecurityZerotrustApplinkAppConnectorProtoGateway do
  def decode(value, options) do
    GoogleApi.BeyondCorp.V1.Model.CloudSecurityZerotrustApplinkAppConnectorProtoGateway.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.BeyondCorp.V1.Model.CloudSecurityZerotrustApplinkAppConnectorProtoGateway do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
